1. Field of the Invention
The present invention relates to an information processing apparatus which performs processing using a font, an information processing method, and a storage medium, when printing a document created by an application.
2. Description of the Related Art
When performing printing which includes print data for information transmission and print data for function display, for example, when distributing a document which is marked “confidential”, a stamp expressing the characters “confidential” can be put on each page of a document. However, manually putting a stamp on each page of a printed material after printing is costly. Therefore, such printing is generally performed by printing an electronic mark such as “confidential” along with the document. The mark such as “confidential” is referred to as a “stamp”.
To print a document with a stamp, an application has to include an input portion for receiving a character string of the stamp desired by the user, the font used for rendering the character string of the stamp and the like. Further, when printing the document, the application has to superimpose the stamp designated by the user on each page of the document, and issue a rendering command of the superimposition results. Namely, each time the stamp to be superimposed on the document is changed, the document itself has to be edited. To improve on such time and effort, there is a method for realizing the stamp function by a printer driver.
The rendering command issued by the application is stored in a spool file as print data. Namely, the spool file is an electronic document format which does not depend on the application. The printer driver has a function of converting the print data stored in the spool file into a print command which can be interpreted by a printer, and supplying the print command to the printer. To realize the stamp function by the printer driver, the character string of the stamp is superimposed on each page of the print data. FIG. 4 illustrates a concept of the superimposition results of print data and the characters to be superimposed in stamp processing. The contents of page 401 in FIG. 4A are created by the application and spooled as print data. Characters 402 in FIG. 4B are a stamp which is superimposed on the print data of each page of the document. Page 403 in FIG. 4C is a page illustrating the results of superimposing the characters 402 of the stamp on the page 401 spooled as print data.
Three methods are known as a method for superimposing characters with a font designated by the user on the print data by the printer driver. They are font embedding, image embedding, and character code embedding. Each of these methods will now be described.
Font embedding is a method in which font form information is embedded into the print data along with a character rendering command by editing the print data with the printer driver. The font form information embedded into the print data is used for rendering the superimposed characters when generating the print command. Thus, this method has the advantage that the output intended by the user can be obtained even if the designated font is not present in the environment for generating the print command. However, because the font form information is embedded in the print data, the print data amount tends to increase. This problem cannot be overlooked especially when embedding fonts which have a large number of character types, such as Japanese fonts.
Image embedding is a method in which an image rendering command is embedded into the print data along with the image rendering the characters by editing the print data with the printer driver. Thus, in this method, the characters are output in the font intended by the user even if the font designated by the user is not present in the environment for generating the print command. However, since the characters are formed as an image, if the image is expanded when generating the print command, the quality of the characters can deteriorate.
Character code embedding is a method in which the character rendering command and a font attribute are embedded into the print data along with a character code which does not depend on the font, by editing the print data with the printer driver. If the font designated by the user is present in the environment for generating the print command, the output intended by the user can be obtained. Further, if the font designated by the user is not present in the environment for generating the print command, rendering using a different font is performed, which is generally called “font replacement”. Even when this font replacement is performed, there is still the advantage that garbled characters and the like are not produced, although the font is different from that designated by the user.
From among these methods for superimposing characters with a font designated by the user on the print data, a suitable method can be selected based on the kind of printer driver or operating system (OS), and on the printer performance and the like. As an example of font embedding processing, a technique has been discussed in which a user interface module of the printer driver inserts on behalf of the application a page on which characters are rendered (see Japanese Patent No. 03897539, for example). Further, a technique has also been discussed where, if an embedded font is included, the embedded font is acquired, and the acquired embedded font is stored along with intermediate data (see Japanese Patent No. 03962559, for example). In addition, another discussed technique is to switch between performing font embedding processing or image embedding processing when expressing the characters in the electronic document (see Japanese Patent Application Laid-Open No. 2005-63052, for example).
While there are various kinds of printer drivers, here the printer driver called “XPS Printer Driver”, which operates using the Windows® OS from Microsoft Corporation, will be described. One of the characteristics of the XPS printer driver is that the format of the device-independent print data stored in the spool file is the same as that of the XPS document data.
The term “XPS” is an acronym for “XML Paper Specification”, and is an open standard electronic document format proposed by Microsoft Corporation. An XPS document has a tree structure with a Fixed Document Sequence (FDS) as its root. The FDS has a plurality of Fixed Documents (FDs), and the FDs have a plurality of Fixed Pages (FPs). The FDS, the FDs, and the FPs may respectively be referred to as “XPS parts”. The FPs write the page contents of the document in an XML language called Extensible Application Markup Language (XAML), and include a rendering command which is actually used during a display or printing process. Resources such as the fonts and images which are used in FP rendering can be shared among a plurality of FPs. Further, the FDS, FDs, and FPs may respectively have their print settings in a Print Ticket (PT) The PTs describe the print settings when printing the XPS document in XML format. Here, the print settings used when printing each FP are a merged PT of the FDS PT, the PT of the parent FD of the printing object FP, and the PT of the printing object FP.
FIG. 5 is an example of a block diagram illustrating a logic structure of an XPS document. The logic structure of an XPS document 501 has a tree structure whose root node is the FDS 503. The FDS 503 has an FD 511 and an FD 513 as children. The FD 511 has an FP 521 and an FP 523 as children. The FD 513 has an FP 525 as a child. With regard to the PTs in which the print settings are written, the FDS 503 holds a PT 531, the FD 511 holds a PT 533, the FP 521 holds a PT 535, and the FD 513 holds a PT 537, respectively. The FP 523 and the FP 525 do not hold a PT. Further, the FP 521 and the FP 523 share a resource 541, such as a font or an image. The FP 525 utilizes a resource 543, such as a font or an image. Here, for example, the PT used when printing the FP 521 is a PT which merges the PT 531, PT 533, and PT 535. Thus, a characteristic of XPS is that it includes the resources which are necessary for display and printing.
FIG. 2 is an example of a block diagram for illustrating a data flow when an XPS printer driver is operating during printing by an application. In FIG. 2, modules configuring the XPS printer driver include a user interface module 217, a layout filter 213, and a render filter 215.
By calling up from an application 201 the user interface module 217 via a printing support function 203 of the OS, the various settings relating to printing can be performed by the user.
If a printing instruction is produced by a user operation from the application 201, the contents of that instruction are sent to the printing support function 203 of the OS. Specifically, a device context (DC), which is a virtual printing region, is created by a graphic device interface (GDI), which is a rendering engine of the OS, and the DC is supplied to the application 201. Then, rendering processing is performed on the DC for each page of the document by the application 201. The rendering contents are converted into XPS format by Microsoft XPS Document Converter (MXDC), whereby XPS format print data is generated. The XPS format print data is temporarily spooled in a storage apparatus as a spool file 205 for each print job by the printing support function 203 of the OS.
In the above description, it was assumed that the application 201 performs the rendering in the GDI. However, if the application is capable of creating the XPS format electronic document, the created XPS format print data can be spooled without relying on the GDI and the MXDC.
The data stored in the spool file 205 is supplied to a filter pipeline 211 called up by a printing pipeline service 207 of the OS. The filter pipeline 211 is configured by an arbitrary number of filters which are written in a printer driver pipeline configuration file (not illustrated). If the print command which can be interpreted by the printing apparatus 120 is not in XPS format, at least a filter for converting the spooled XPS format data into a print command is necessary. In FIG. 2, the filter pipeline 211 is configured by the layout filter 213 and the render filter 215. The layout filter 213 acquires XPS format print data from the spool file 205, edits the print data as necessary based on the print settings, and outputs the edited print data. For example, if a stamp is designated in the print settings, the layout filter 213 can embed the command for rendering the stamp in the print data with the resource, such as the font or image.
If there is no need for processing the print data, the acquired print data is output as is. The output of the layout filter 213 is supplied to the render filter 215. The render filter 215 performs the rendering processing on each page of the supplied XPS format print data, performs the necessary image processing, converts the resultant data into the print command, and outputs the print command. The print command output by the render filter 215 is supplied to the printing apparatus 120, and the printing apparatus 120 executes the printing operation.
However, when realizing the stamp function in the XPS printer driver, there are the following problems.
First, in the conventional font embedding method, when a font which is prohibited from being embedded into the electronic document is designated as a stamp of the print setting, there is the problem that the layout filter 213 cannot embed the font in XPS format print data. Conversely, the user interface module 217 can be created, which prevents the stamp of the print settings from designating a font that is prohibited from being embedded. However, there is the problem that the number of font options is decreased.
Next, in the conventional image embedding method, when the layout filter 213 embeds an image rendering the characters of the stamp in the XPS print data, there is the problem that the stamp, which supposedly is meant to be processed as a character, is processed as a common image. When the render filter 215 generates the print command from the supplied XPS format print data, the character stamp is an image. Thus, the color processing and halftone processing which should be applied on to characters are not applied, and processing other than that for images, such as for graphics or photographs, is applied. Therefore, there is the problem that the quality of the character portion of the stamp in the print results deteriorates.
Finally, in the conventional character code embedding method, when the layout filter 213 embeds the character code of the stamp in the XPS print data, the font is not embedded in the XPS format print data. More specifically, when rendering the XPS print data, there is the problem that print data which lacks the necessary font resources is supplied to the render filter 215.